package com.ruoyi.buss.task.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.buss.task.mapper.DataTaskPersonRelationMapper;
import com.ruoyi.buss.task.domain.DataTaskPersonRelation;
import com.ruoyi.buss.task.service.IDataTaskPersonRelationService;

/**
 * 营销任务和目标关系Service业务层处理
 * 
 * @author sxy
 * @date 2021-07-16
 */
@Service
public class DataTaskPersonRelationServiceImpl implements IDataTaskPersonRelationService 
{
    @Autowired
    private DataTaskPersonRelationMapper dataTaskPersonRelationMapper;

    /**
     * 查询营销任务和目标关系
     * 
     * @param taskId 营销任务和目标关系ID
     * @return 营销任务和目标关系
     */
    @Override
    public DataTaskPersonRelation selectDataTaskPersonRelationById(String taskId)
    {
        return dataTaskPersonRelationMapper.selectDataTaskPersonRelationById(taskId);
    }

    /**
     * 查询营销任务和目标关系列表
     * 
     * @param dataTaskPersonRelation 营销任务和目标关系
     * @return 营销任务和目标关系
     */
    @Override
    public List<DataTaskPersonRelation> selectDataTaskPersonRelationList(DataTaskPersonRelation dataTaskPersonRelation)
    {
        return dataTaskPersonRelationMapper.selectDataTaskPersonRelationList(dataTaskPersonRelation);
    }

    /**
     * 新增营销任务和目标关系
     * 
     * @param dataTaskPersonRelation 营销任务和目标关系
     * @return 结果
     */
    @Override
    public int insertDataTaskPersonRelation(DataTaskPersonRelation dataTaskPersonRelation)
    {
        dataTaskPersonRelation.setCreateTime(DateUtils.getNowDate());
        return dataTaskPersonRelationMapper.insertDataTaskPersonRelation(dataTaskPersonRelation);
    }

    /**
     * 修改营销任务和目标关系
     * 
     * @param dataTaskPersonRelation 营销任务和目标关系
     * @return 结果
     */
    @Override
    public int updateDataTaskPersonRelation(DataTaskPersonRelation dataTaskPersonRelation)
    {
        return dataTaskPersonRelationMapper.updateDataTaskPersonRelation(dataTaskPersonRelation);
    }

    /**
     * 批量删除营销任务和目标关系
     * 
     * @param taskIds 需要删除的营销任务和目标关系ID
     * @return 结果
     */
    @Override
    public int deleteDataTaskPersonRelationByIds(String[] taskIds)
    {
        return dataTaskPersonRelationMapper.deleteDataTaskPersonRelationByIds(taskIds);
    }

    /**
     * 删除营销任务和目标关系信息
     * 
     * @param taskId 营销任务和目标关系ID
     * @return 结果
     */
    @Override
    public int deleteDataTaskPersonRelationById(String taskId)
    {
        return dataTaskPersonRelationMapper.deleteDataTaskPersonRelationById(taskId);
    }
}
